package com.zyms.controller.api.token;

import com.zyms.controller.baseController.BaseController;
import com.zyms.module.result.ResultObj;
import com.zyms.service.TokenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by Baggio on 2018-2-2.
 */
@Controller
@RequestMapping("/api/token")
public class TokenController extends BaseController {

    @Autowired
    TokenService tokenService;
    @RequestMapping(value="/createToken",method = RequestMethod.POST)
    @ResponseBody
    public ResultObj createToken() {
        logger.info("=============================index==============================================>>>>>>");
        ResultObj resultObj=new ResultObj();

        String token=tokenService.createToken();

            resultObj.setData(token);

        return resultObj;
    }
}
